package com.ruoyi.airspaceFlight.service.impl;

import java.util.ArrayList;
import java.util.List;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.airspaceFlight.domain.FlyApply;
import com.ruoyi.airspaceFlight.dto.resp.FlypplyAndActionVo;
import com.ruoyi.airspaceFlight.mapper.FlyApplyMapper;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.airspaceFlight.mapper.FlyActionMapper;
import com.ruoyi.airspaceFlight.domain.FlyAction;
import com.ruoyi.airspaceFlight.service.IFlyActionService;

/**
 * 飞行实施计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-06
 */
@Service
public class FlyActionServiceImpl implements IFlyActionService 
{
    @Autowired
    private FlyActionMapper flyActionMapper;

    @Autowired
    private FlyApplyMapper flyApplyMapper;
    /**
     * 查询飞行实施计划
     * 
     * @param flyActionId 飞行实施计划主键
     * @return 飞行实施计划
     */
    @Override
    public FlyAction selectFlyActionByFlyActionId(String flyActionId)
    {
        return flyActionMapper.selectFlyActionByFlyActionId(flyActionId);
    }

    /**
     * 查询飞行实施计划列表
     * 
     * @param flyAction 飞行实施计划
     * @return 飞行实施计划
     */
    @Override
    public List<FlyAction> selectFlyActionList(FlyAction flyAction)
    {

        List<FlyAction> flyActions = flyActionMapper.selectFlyActionList(flyAction);

        return  flyActions;
    }

    /**
     * 新增飞行实施计划
     * 
     * @param flyAction 飞行实施计划
     * @return 结果
     */
    @Override
    public int insertFlyAction(FlyAction flyAction)
    {
        flyAction.setCreateTime(DateUtils.getNowDate());
        return flyActionMapper.insertFlyAction(flyAction);
    }

    /**
     * 修改飞行实施计划
     * 
     * @param flyAction 飞行实施计划
     * @return 结果
     */
    @Override
    public int updateFlyAction(FlyAction flyAction)
    {
        flyAction.setUpdateTime(DateUtils.getNowDate());
        return flyActionMapper.updateFlyAction(flyAction);
    }

    /**
     * 批量删除飞行实施计划
     * 
     * @param flyActionIds 需要删除的飞行实施计划主键
     * @return 结果
     */
    @Override
    public int deleteFlyActionByFlyActionIds(String[] flyActionIds)
    {
        return flyActionMapper.deleteFlyActionByFlyActionIds(flyActionIds);
    }

    /**
     * 删除飞行实施计划信息
     * 
     * @param flyActionId 飞行实施计划主键
     * @return 结果
     */
    @Override
    public int deleteFlyActionByFlyActionId(String flyActionId)
    {
        return flyActionMapper.deleteFlyActionByFlyActionId(flyActionId);
    }
}
